#ifndef __UART_COMM__H
#define __UART_COMM__H

#include "../../lv_drv_conf.h"

#if (LV_USE_FS_POSIX == 1)

#include "lvgl/lvgl.h"

#define SERIAL_PORT "/dev/ttyS2"
#define DELAY_MS 100
#define BUFFER_SIZE 1024

typedef struct{
	int fd;
	void (*analysis_fun)(uint8_t fun, uint8_t *data, uint16_t len);
	uint8_t step;
	uint8_t cnt;
	uint8_t buff[512];
	uint8_t rx_data;
	uint8_t rxlen;
}AcRxTemp_t;


typedef union{
	float f;
	uint8_t u8[sizeof(float)];	
}fl_u8_t;

void Action_init(void);
void Comm_tx_uint16(uint8_t fun, uint16_t data);
void Comm_tx(uint8_t fun, uint8_t *data, uint8_t datalen);
void Comm_tx_uint8(uint8_t fun, uint8_t data);

void ActionRx_ForUart(AcRxTemp_t * AcRxTemp, uint8_t data);
extern AcRxTemp_t AcRx;
#endif
#endif

/******************* (C) COPYRIGHT 2023 FUYEBING *****END OF FILE************/
